From: Florian Müllner Date: Fri, 20 May 2011 11:57:38 +0000 (+0200) Subject: search-display: Try harder to use a correct drag actor source X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8166 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b9456caeb0bd83f96c390f328fcccf3297c4d2fa;p=gnome-shell.git search-display: Try harder to use a correct drag actor source Commit 429f809b7 fixed an exception in getDragActorSource(), but the returned actor is only an approximation (e.g. in contrast to the actual drag actor, it includes the label). Try a bit harder to return the correct actor and only fall back to the approximation when necessary. https://bugzilla.gnome.org/show_bug.cgi?id=645990 --- diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js index fdf918f3e..bdaa59c8d 100644 --- a/js/ui/searchDisplay.js +++ b/js/ui/searchDisplay.js @@ -28,6 +28,7 @@ SearchResult.prototype = { x_align: St.Align.START, y_fill: true }); this.actor._delegate = this; + this._dragActorSource = null; let content = provider.createResultActor(metaInfo, terms); if (content == null) { @@ -37,7 +38,11 @@ SearchResult.prototype = { let icon = new IconGrid.BaseIcon(this.metaInfo['name'], { createIcon: this.metaInfo['createIcon'] }); content.set_child(icon.actor); + this._dragActorSource = icon.icon; this.actor.label_actor = icon.label; + } else { + if (content._delegate && content._delegate.getDragActorSource) + this._dragActorSource = content._delegate.getDragActorSource(); } this._content = content; this.actor.set_child(content); @@ -76,6 +81,8 @@ SearchResult.prototype = { }, getDragActorSource: function() { + if (this._dragActorSource) + return this._dragActorSource; // not exactly right, but alignment problems are hard to notice return this._content; },